﻿
Office._context_mailbox_item_to_emailaddress = function () {
    //just an example to show how additional arrays can be created
    this.email = "";
};

Office._context_mailbox_item = function () {
    ///<field name="itemType" type='Object'>(Message and Appointment) The Item Type</field>
    ///<field name="itemClass" type='Object'>(Message and Appointment) The Item Class</field>
    ///<field name="from" type='Object'>(Message Item) The senders email</field>
    ///<field name="to" type='Object'>(Message Item) The receivers email</field>
    ///<field name="sender" type='Object'>(Appointment Item) The senders email</field>
    ///<field name="organizer" type="String">(Appointment Item) The Organizer</field>

    this.loadCustomPropertiesAsync = function (callback, userContext) {
        ///<summary>(Message and Appointment) load custom properties </summary>
        ///<param name="callback" type="Function">The callback</param>
        ///<param name="userContext" type="Object">The usercontext</param>
    };
    this.getEntities = function () {
        ///<summary>(Message and Appointment) get Entities </summary>
    };
    this.getEntitiesByType = function (entityType) {
        ///<summary>(Message and Appointment) get Entities by Type</summary>
        ///<param name="entityType" type="OfficeEnum.EntityType">The Outlook EntityType</param>
    };
    this.getFilteredEntitiesByName = function () { };
    this.getRegExMatches = function () { };
    this.getRegExMatchesByName = function () { };

    this.itemType = {};
    this.itemClass = {};

    this.from = {};
    this.to = new Array(new Office._context_mailbox_item_to_emailaddress());
    this.sender = {};
    this.cc = {};
    this.conversationId = {};
    this.internetMessageId = {};
    this.normalizedSubject = {};
    this.sender = {};
    this.subject = {};

    this.organizer = {};
    this.end = {};
    this.location = {};
    this.normalizedSubject = {};
    this.optionalAttendees = {};
    this.requiredAttendees = {};
    this.resources = {};
    this.start = {};
    this.organizer = {};

}


Office._$MailboxMessage = function () {
    this.from = {};
    this.to = new Array(new Office._context_mailbox_item_to_emailaddress());
    this.cc = {};
    this.conversationId = {};
    this.internetMessageId = {};
    this.normalizedSubject = {};
    this.sender = {};
    this.subject = {};

    this.getEntities = function () {
        ///<summary>(Message and Appointment) get Entities </summary>
    };
    this.getEntitiesByType = function (entityType) {
        ///<summary>get Entities by Type</summary>
        ///<param name="entityType" type="OfficeEnum.EntityType">The Outlook EntityType</param>
    };
    this.getFilteredEntitiesByName = function () { };
    this.getRegExMatches = function () { };
    this.getRegExMatchesByName = function () { };

};

Office._$MailboxAppointment = function () {
    this.end = {};
    this.location = {};
    this.normalizedSubject = {};
    this.optionalAttendees = {};
    this.requiredAttendees = {};
    this.resources = {};
    this.start = {};
    this.organizer = {};

    this.sender = {};
    this.subject = {};

    this.getEntities = function () {
        ///<summary>get Entities </summary>
    };
    this.getEntitiesByType = function (entityType) {
        ///<summary>get Entities by Type</summary>
        ///<param name="entityType" type="OfficeEnum.EntityType">The Outlook EntityType</param>
    };
    this.getFilteredEntitiesByName = function () { };
    this.getRegExMatches = function () { };
    this.getRegExMatchesByName = function () { };
};

Office._context_mailbox_userprofile = function () {

};

Office._context_mailbox = function () {
    var instance = new Office._context_mailbox_item();
    this.item = intellisense.nullWithCompletionsOf(instance);

    this.displayAppointmentForm = function (id) {
        ///<summary> Displays and appointment Form</summary>
        ///<param name="id" type="integer">The id of the form</param>
    };
    this.userProfile = new Office._context_mailbox_userProfile();
    //add additional api items here
}

Office._OutlookEnums= function () {
        this.EntityType = {
            MeetingSuggestion: "meetingSuggestion",
            TaskSuggestion: "taskSuggestion",
            Address: "address",
            EmailAddress: "emailAddress",
            Url: "url",
            PhoneNumber: "phoneNumber",
            Contact: "contact"
        };
        this.ItemType = {
            Message: 'message',
            Appointment: 'appointment'
        };
        this.ResponseType = {
            None: "none",
            Organizer: "organizer",
            Tentative: "tentative",
            Accepted: "accepted",
            Declined: "declined"
        };
    };




    